package by.msokoloff.javaweb2015.datamodel;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import by.msokoloff.javaweb2015.datamodel.enums.PlaneStatus;

@Entity
@Table(name = "plane")
public class Plane extends AbstractEntity {

	@ManyToOne
	private PlaneModel planeModel;

	@Column(name = "board_number")
	private String boardNumber;

	@Column(name = "status")
	@Enumerated(EnumType.STRING)
	private PlaneStatus status;

	public PlaneModel getPlaneModel() {
		return planeModel;
	}

	public void setPlaneModel(PlaneModel planeModel) {
		this.planeModel = planeModel;
	}

	public String getBoardNumber() {
		return boardNumber;
	}

	public void setBoardNumber(String boardNumber) {
		this.boardNumber = boardNumber;
	}

	public PlaneStatus getStatus() {
		return status;
	}

	public void setStatus(PlaneStatus status) {
		this.status = status;
	}

	@Override
	public String toString() {
		return "[Plane: " + this.planeModel.getName() + "; Board number: " + this.boardNumber + "]";
	}

}
